package com.luyu.caffeinedemo.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.TimeUnit;

/**
 * @author luYuHan
 * @date 2023/8/5 15:44
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = "com.luyu.repeatsubmit",ignoreInvalidFields = true)
public class RepeatSubmitProperty {
    // 请大于配置的数据,不然会存在管理器未删除,
    private Integer time;

    private String errorMsg;
    /**
     * 如果使用注解就没有进行配置就直接使用userId，如果配置了就使用对应的key
     */
    private String key;
    /**
     * 判断重复提交的条件
     */
    private String value;

    private String type = "SingleNode";

    private String exception;

    private TimeUnit timeUnit;

    private Integer maxSize;

}
